const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const publishSchema = new Schema({
    userId: {
        type: String,
        require: true,
    },
    avator:{
        type: String,
        require: true, 
    },
    nickName:{
        type: String,
        require: true,
    },
    passangerSum: {
        type: Number,
        require: true,
    },
    timestamp: {
        type: Date,
        require: true,
    },
    Departure: {
        type: String,
        require: true,
    },
    Destination: {
        type: String,
        require: true,
    },
    message: {
        type: String,
        require: true
    },
},
    {
        collection: 'publish', versionKey: false
    })

module.exports = mongoose.model('Publish', publishSchema)